package edu.sctu.xialei.May.day20150527one;

import java.util.Scanner;

/**
 * Created by Administrator on 5/27/2015.
 */
public class StudentAllInfo {

    Scanner input = new Scanner(System.in);

    public Student setStudent(){

        System.out.println("录入学生信息\n");

//        录入学生基本信息
        Student student = new Student();

        System.out.println("录入姓名：");
        String name = input.next();
        student.name = name;

        System.out.println("录入学号：");
        int number = input.nextInt();
        student.number = number;

        System.out.println("录入性别：");
        student.sex = input.next();

//        录入学生的校园卡信息
        StudentCard studentCard = new StudentCard();

        studentCard.studentName = name;
        studentCard.StudentNumber = number;

//        录入校园卡余额
        System.out.println("录入校园卡余额：");
        studentCard.money = input.nextFloat();

        student.studentCard = studentCard;

        return student;
    }


    public void printStudentInfo(Student student){
        System.out.println("\n\n该生信息");
        System.out.print("姓名：" + student.name + "  学号：" + student.number + "  性别：" + student.sex + "  校园卡余额："
                + student.studentCard.money + "  座位号：" + student.seat.seatNumber);
    }
}
